
//
//  XJPaySectionHeaderView.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/6/13.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJPaySectionHeaderView.h"

@interface XJPaySectionHeaderView()
@property(nonatomic, strong) UIView *bgView;
@property(nonatomic, strong) UILabel *tipLb; //请选择付款方式

@end

@implementation XJPaySectionHeaderView


//init
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    
    if(self) {
        [self setupView];
    }
    
    return self;
}

- (void)setupView {
    [self.contentView addSubview:self.bgView];
    
    [self.bgView addSubview:self.tipLb];

}

//2.lazy
- (UIView *)bgView {
    if (!_bgView) {
        _bgView = [UIView new];
    }
    return _bgView;
}

- (UILabel *)tipLb {
    if (!_tipLb) {
        _tipLb = [UILabel new];
        _tipLb.text = @"请选择付款方式";
        _tipLb.font = XJFONTSET_M(17.0);
    }
    return _tipLb;
}

//3.layout h:44
- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    
    [self.tipLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.bgView.mas_left).offset(15);
        make.centerY.equalTo(self.bgView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(200, 30));
    }];
}

@end
